package com.example.demo;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo")
public class DemoController {

    @NacosValue(value = "${test.name}", autoRefreshed = true)
    private String name;

    @NacosValue(value = "${test.name2}")
    private String name2;

    @RequestMapping("/name")
    public String getName() {
        return this.name;
    }

    @RequestMapping("/name2")
    public String getName2() {
        return this.name2;
    }
}